<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
遍历文章列表：
<ul>
    <li th:each="item : ${current.records}">
        <a th:href="@{${#qyUrl.getUrl('article',item.alias)}}" th:text="${item.title}"/>
    </li>
</ul>
总共有[[${current.totalPages}]]页


<button th:if="${pageNumber}>1" onclick="prev()">上一页</button>
<button th:if="${pageNumber}<${current.totalPages}" onclick="next()">下一页</button>

<script>
    function prev() {
        let pageNumber = [[${pageSize}]];
        if (pageNumber > 1) {
            pageNumber--;
        }
        window.location.href = `?pageNumber=${pageNumber}&pageSize=[[${pageSize}]]`;
    }
    function next() {
        let pageNumber = [[${pageNumber}]];
        const totalPages = [[${current.totalPages}]];
        if (pageNumber < totalPages) {
            pageNumber++;
        }
        window.location.href = `?pageNumber=${pageNumber}&pageSize=[[${pageSize}]]`;
    }
</script>
</body>
</html>
